package com.icart.repositories;


import com.icart.entities.CuCusttcmeteitemEntity;
import org.springframework.context.annotation.Scope;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
@Scope("prototype")
public interface CusttcmeteitemRepository extends BaseRepository<CuCusttcmeteitemEntity,Integer> {
    @Transactional
    @Query(nativeQuery = true,value = "insert into cu_custtcmeteitem (tcoid, custid, tcid, metaitemid, mcount) " +
            "select ?1,?2,tcid, metaitemid, mcount from mk_discmeteitem where tcid=?3")
    @Modifying(clearAutomatically = true)
    Integer save(Long tcoid,Long custid,Long tcid);
}
